package com.yixun.qfbao.interceptor.forbidrepeatclick.response;

import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.yixun.qfbao.xf.model.enums.ResultEnum;

/**
 * @author zilong.liu
 * @date 2020-11-23
 *
 * desc:
 *     
 */
@Component("stringTypeResponse")
public class StringTypeResponse implements ResTypeResponse {
	
	private static final JSONObject resJson = new JSONObject();
	
	static {
		resJson.put("result", ResultEnum.REPEAT_CLICK.getNo());
		
	}
	
	/**
	 * 
	 * @return
	 */
	@Override
	public Object getResObj() {
		return resJson.toJSONString();
	}
	
	@Override
	public Object getExceptionResObj(String errorMsg) {
		JSONObject exceptionResJson = new JSONObject();
		exceptionResJson.put("result", ResultEnum.FAIL.getNo());
		exceptionResJson.put("errorMsg", errorMsg);
		return exceptionResJson;
	}
}
